﻿Public Enum ConfigFileFormat
    XML
    Binary
End Enum
Public Class ConfigBase
    Protected tblConfig As Hashtable
    Public Sub SaveConfig(ByVal strConfigFileName As String, ByVal ConfigFormat As ConfigFileFormat)
        Select Case ConfigFormat
            Case ConfigFileFormat.XML
                IOSystemBase.WriteHashTableToXMLFile(strConfigFileName, tblConfig)
            Case ConfigFileFormat.Binary
                IOSystemBase.WriteHashTableToBinaryFile(strConfigFileName, tblConfig)
        End Select
    End Sub
    Public Sub ReadConfig(ByVal strConfigFileName As String, ByVal ConfigFormat As ConfigFileFormat)
        Dim rtnHashTable As Hashtable = Nothing
        Select Case ConfigFormat
            Case ConfigFileFormat.XML
                rtnHashTable = IOSystemBase.ReadHashTableXMLFile(strConfigFileName)
            Case ConfigFileFormat.Binary
                rtnHashTable = IOSystemBase.ReadHashTableFromBinaryFile(strConfigFileName)
        End Select
        tblConfig = rtnHashTable
    End Sub
End Class
Public Class LogBase
    Private strLogFileName As String
    Private swLog As IO.StreamWriter
    Private swErrLog As IO.StreamWriter
    Sub New(ByVal LogFileName As String, ByVal ErrLogFileName As String)
        swLog = New IO.StreamWriter(LogFileName, True)
        swErrLog = New IO.StreamWriter(ErrLogFileName, True)
    End Sub
    Sub Writelog(ByVal strLog As String)
        swLog.WriteLine(strLog)
    End Sub
    Sub writelog(ByVal ex As System.Exception)

    End Sub
    Protected Overrides Sub Finalize()
        MyBase.Finalize()
    End Sub
End Class


